package com.fly.auth.user.pojo

import cn.hutool.core.bean.BeanUtil
import com.fly.auth.user.entity.User
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty

/**
 * @author  fly
 * @date  2021/5/21 14:38
 * @version 1.0
 */
@ApiModel("操作用户参数")
data class UserDto(

    @ApiModelProperty("id")
    var id: Long? = null,

    @ApiModelProperty("用户名")
    var name: String? = null,

    @ApiModelProperty("密码")
    var password: String? = null,

    @ApiModelProperty("邮箱")
    var email: String? = null
)

fun UserDto.toUser() = User().apply { BeanUtil.copyProperties(this, this@apply) }
